package com.kobe.game_20;

/**
 * 
 * A Pythagorean triplet is a set of three natural numbers, a<b<c, for which,
 * 
 * 
 * a#2 + b#2 = c#2
 * 
 * For example, 3#2 + 4#2 = 9 + 16 = 25 = 5#2.
 * 
 * There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find
 * the product abc.
 * 
 * the Result is: 31875000
 */
public class Game_9 {

    public static void main(String[] args) {
        for (int a = 5; a <= 330; a = a + 5) {
            for (int b = a + 5; b <= 495; b = b + 5) {
                if ((a * a + b * b == (1000 - a - b) * (1000 - a - b))
                        && (b < (1000 - a - b))) {
                    System.out.println("the Result is:  " + a * b
                            * (1000 - a - b));
                }
            }
        }

    }

}
